package cn.wolfcode.rbac.domain;

import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Role
        extends BaseDomain {
    private String name;
    private String sn;

    public void setName(String name) {
        this.name = name;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public void setPermissions(List<Permission> permissions) {
        this.permissions = permissions;
    }

    public String getName() {
        return this.name;
    }

    public String getSn() {
        return this.sn;
    }

    public List<Permission> getPermissions() {
        return this.permissions;
    }

    private List<Permission> permissions = new ArrayList();

    public String getJson() {
        Map map = new HashMap();
        map.put("id", id);
        map.put("name", name);
        map.put("sn", sn);
        map.put("permissions", permissions);
        return JSON.toJSONString(map);
    }
}
